Writing in Code
by ice-crisis
Summary: At Wammy's, Matt and Mello get caught passing notes in class one too many times. To get back at their teachers, they decide to write an unreadable code. But does Matt have an ulterior motive? And why is Near spying on them? Matt/Mello, T for language.


**Hey all! This is my first time posting a Death Note fic, so let me know what you think, ok? :)**

**Disclaimer 1: I do not own Death Note, or its characters, and I'm not making any money off this anyway, so suing me over it would be kind of silly, yeah? Glad we undrstand each other, then.**

**Disclaimer 2: The details of the Code itself, which I had to work out at least a little bit or the story wouldn't work, get a little bit complicated at the end (that's kind of the point). You really don't have to understand it to enjoy the story, though. Mostly it's there just to make the kids look smart. But in case there are people reading who do know what I'm talking about, I'd just like to say that I'm not a linguist, or a mathemetician, OR a genius. I just know enough to make it look complicated. If anybody is confused by the numbers, however, you can look up "number base" on Wikipedia and it will take you to an article that might explain a little.**

**And now, on with the story! **

* * *

_Hey, what's the answer to number six?_

_Do it yourself._

_Come on, tell me! Please!_

_No! I'm working, stop distracting me._

Matt stared at the scrap of paper incredulously.

_You finished this worksheet ten minutes ago_, he wrote, _what could you possibly be working on?_

He shoved the paper over to his best friend, who glared at him before snatching it up, giving it a cursory glance and then scribbling a response.

_I'M WORKING,_ it read, and Matt could almost see the irritation seeping from the capitol letters. _Do the damn problem yourself!_ _And stop bothering me! If Mr. Walters catches you passing notes to me again that asshole will give us BOTH detention._

Matt sighed. All he wanted was an answer to one problem! Sure, he _could_ do it himself, but he was bored of the pointless worksheet that had been assigned to them as busy-work, and since Mello was already finished he didn't see why his best friend couldn't just tell him the answer. It wasn't like Matt was going to learn anything by doing the problem himself—he already knew how; he just didn't feel like doing it. He picked up his pencil again, but instead of finishing the worksheet he began writing on the small piece of paper they had been passing back and forth.

_Tell me the answer and I'll stop bothering you! _Matt wrote. _You know this worksheet is a waste of time for us anyway, I just want to get back to my game so I can finish leve—_

He hadn't even finished the sentence when the paper was snatched out from under his hands. Matt froze for a split second, then looked up at the forbidding old man that was glaring down at him.

"Err," he murmured, "hey, Mr. Walters."

"Passing notes again, Matt?" growled their ever-cheerful physics teacher. "I believe I have warned you of the consequences already this week, have I not?"

"Yes, Mr. Walters," Matt mumbled. Then the man's glare shifted from the unfortunate boy to the paper itself. Matt screwed his eyes shut.

Several seconds passed.

"Well, Matt," the teacher said quietly, and the boy could practically feel the cold fury radiating off the man, "if you believe this class to be pointless, then I'm sure you can find far better uses for your time in detention this week." He paused. "And next week," he added. Then his gaze shifted to Mello, who had all this time been pretending to be working diligently. Matt could tell by his tense posture, however, that his blond friend was well aware of the situation.

"And your friend Mello can join you," said Mr. Walters, "for his use of vulgar language."

If Matt didn't know any better he could have sworn he heard Mello _growl_ at that proclamation.

It was only after Mr. Walters had stalked back to the front of the room that Matt risked glancing at Mello. He wished he hadn't, though, because Mello looked like he wanted to go on a rampage and slaughter puppies.

Crap. When class over Mello was going to _kill _him.

Matt sighed, and finished his worksheet.

He hated it when Mello was mad at him.

--

The first time Matt and Mello had been caught passing notes during class they had gotten off with a warning. This was because the note hadn't actually said anything criminal, and the class had been almost over anyway. The second time, they had each been given extra homework. Matt had been rather indignant about that. After all, he said, when he'd written that the teacher looked like a pig he hadn't meant it as an _insult_, and there was no reason to get upset about it or anything. Mello hadn't particularly cared, fortunately, because he always did extra homework anyway to keep on top of the class.

The third time the two twelve year olds had been caught, the messages had been none to flattering in regards to their physics teacher. They had also been in French. It was simply their bad luck that the teachers at Wammy's were no slackers, and he happened to be fluent in six languages, French among them. That time they had been denied lunch, and Matt's video games had been confiscated for two whole days.

After the sixth time they had been caught passing notes in class they had stopped bothering with foreign languages. Whatever language they wrote in, it always seemed that the teachers knew what it said. So they had tried to rely on stealth instead.

It wasn't exactly working.

"_Sixteen times_," Roger scolded them. It was that afternoon, and Matt and Mello had been sent to Roger's office before their detention. Mello still looked pretty murderous, and Matt's games had been taken away again so he was feeling antsy. "The two of you have been caught passing notes in class _sixteen times_. I know you are both very bright—being at the top of the rankings is impressive, after all—but that does not mean you should ignore your classes and slight your teachers this way!"

Mello remained silent. Matt sighed.

"Yes, Roger," he said, trying to sound submissive and not annoyed. Roger was right, after all. Being caught sixteen times was a disgrace. Two geniuses should be able to fool their teachers better than that. Clearly being a ninja was not in his future, he thought sadly.

Roger shook his head.

"While the two of you are in detention I want you to do something _constructive_," he said. "And I want you to think about how hard your teachers work to make sure students like yourselves get an impeccable education." He looked at them over the top of his glasses. "It is a privilege to be a student of Wammy's House," he said sternly. "Try not to take it so lightly."

"Yes, Roger," they chorused in response, and were sent on their merry way.

The first hour of detention was excruciating. All they had to do were some extra physics worksheets and a few writing assignments on ethics. Other than that all Matt could do to occupy his time was think, as Roger had suggested, about their failure.

"Hey, Mello," he said, sometime in the second hour. The blond had calmed down a little and Matt thought it was probably safe to talk to him again. Even if it wasn't, he couldn't help but voice the thought that had just occurred to him. "Do you ever think that maybe the reason we keep getting punished for passing notes isn't because we're passing notes but because the teachers can read them?"

Mello looked up from his textbook on chaos theory.

"What?"

Matt toyed with his pencil.

"Like… you know," he said. "It's not just that we're passing notes but the content of the notes that pisses them off."

Mello shrugged and went back to reading.

"Obviously," he said disinterestedly. "If I hadn't called Mr. Walters an asshole I wouldn't even _be_ here."

"Exactly," said Matt, suddenly grinning. "So, if we could find a way to communicate that they couldn't understand we wouldn't get in so much trouble, right?"

Mello looked up again, this time his interest peaked.

"What are you suggesting?"

Matt held up a math textbook that had been lying on the table.

"I think we should write a code," he said. "One that's so complicated that no one else can figure it out. That way, when the teachers catch us passing notes they can't be mad about what we say about them, right? And if the code is uncrackable, they can't hold it against us, can they? 'cause we've outsmarted them, right?"

Mello shut his book.

"Roger did say he wanted us to do something constructive," he said. He smirked. "And if the two of us pool all our talents, there's no way anyone could ever break it."

"That," said Matt, "and it'll really piss the teachers off that we could be saying _anything_ about them and they wouldn't know, but they can't legitimately do anything about it because for all they know it could be a baseless accusation. It's like revenge!"

Mello grinned.

"I like the way you think, Matt," he said.

Matt blinked, and turned away slightly as he felt his cheeks begin to redden. He coughed quietly, wondering not for the first time if there was something wrong with him, and started thumbing through the textbook.

"Let's do it," he said.

And thus, the Code was born.

--

Even at ten years old, Near had an irritating tendency to get underfoot. He was small for his age, and easily overlooked, so often it was only at the last moment that people noticed he was there. Usually this was the exact time they did _not_ want anyone listening in. As a quiet, unobtrusive, and incredibly bright little boy, he could usually find ways to turn this phenomenon to his advantage. It wasn't that he eavesdropped on people, he reasoned, just that people were careless about who was listening in. It wasn't his fault that people bragged about their misdeeds while in his presence, and because it was his duty to report them they should not be angry with him, but with themselves.

Needless to say, Near didn't have a lot of friends at the orphanage.

The one who hated him most, though, was Mello, and this had always perplexed him. Mello _always_ knew when Near was listening in, and he never got in trouble because of Near unless it was for something he had done to Near himself. It was like Mello had some sort of radar, or his hatred was so strong that he couldn't help but notice that Near was there. Mello never overlooked him, and he _never_ took him lightly.

Because of this, and in the face of all logic, Near rather liked Mello. He was one of the few people in the orphanage who saw Near as a rival and not a nuisance. Even though he knew that when Mello looked at him what he saw was not a person but a number, an obstacle, it was still somehow gratifying that Mello saw him at all. There were, after all, so many who didn't.

He'd been kicked out of the main recreation room again. One of the older boys had been telling his girlfriend about how he had been sneaking alcohol into the orphanage, and when Near had politely informed him that this was against the rules, he hadn't appreciated it. Near had remained indifferent through the yelling and name-calling, but when the older boy had lunged at him he had snatched up his favorite robot and run for his life.

So it was that Near was treading lightly along the carpeted hallways of Wammy's, robot clutched firmly beneath one arm, on his way to Roger's office when he noticed that the door to one of the classrooms was ajar.

He paused.

Usually the classrooms weren't used so late in the day. The orphans generally liked to play outside or in the rec rooms, and they studied in the libraries or their dorms. In fact, the only use the classrooms had after dinner was for detentions. The voices emanating from the room, however, didn't sound much like kids that were being punished.

"So if we say that those that are left-branching are in base three—"

"We _can't_ put them in base three, we'd end up with ten million three digit numbers! It'd be way too confusing—"

"But if we mark them—"

"We'd know what base we're working with, sure, but we still wouldn't be able to tell where the numbers break. We need bigger bases to—"

"Okay, fine, but I still want to make a distinction for head final constituency."

Near stepped closer to peak through the door. He was, after all, a detective at heart, and nothing if not curious.

Mello and Matt were inside, arguing heatedly over what looked like several pages of numbers. Near frowned. He'd heard that they had both gotten detention for two weeks for passing notes in class. He hadn't expected that they would actually enjoy it, however. Even more bizarre was their conversation.

"Yeah, yeah," Matt was saying, scribbling down a notation on one of the sheets of paper. "We can do that, but I'm _telling_ you that if we use anything lower than base five for something common even we're going to have trouble keeping up with it. Two digits isn't that hard to follow, and the markers will help, but once you break into three it's going to get ugly."

Mello shook his head.

"I still say you're underestimating our abilities," he said. "The highest number we'd have to work with is," he paused for a moment, as if calculating, "…one thousand. Shit, you're right."

Matt grinned.

"Good job," he said. "You're getting faster."

Mello glared at him, but to Near, who was used to the receiving end of Mello's temper, it didn't seem as if it held any real malice.

"Shut up," he said, flopping into a chair and pulling a chocolate bar out of his pocket. Near wondered for a moment how he had managed to sneak that into detention, but dismissed it as unimportant. "We've been working on this thing for a week, I'd _better_ be getting faster or else _nobody's_ going to be able to bloody read it, including us."

"We've all got to do our part," Matt said airily. "And hey, my Greek is improving."

"Yeah, maybe," countered Mello, "but your Russian still…" he trailed off, frowning.

Matt blinked.

"Mello? What's up?"

Mello glanced up at him sharply and then scowled. If looks could kill, someone was about to up the murder statistics by one, and Near had a feeling he knew who it was.

Unfortunately, he was right.

Mello stomped over and yanked the door fully open.

"What the hell do you want, Near?"

Near looked back at the boy who hated him most with a passive stare.

"Want, Mello?" he said. "Nothing. I was simply on my way to Roger's office when I noticed that this door was open."

"Going to tattle on someone again?" sneered Mello.

Near shrugged.

"I am only fulfilling my duty to the orphanage in making sure it is run in a just manner," he replied blandly.

Matt leaned around his best friend to get a good look at who was at the door.

"Oh. Hey, Near," he said cheerfully. Near nodded to him.

Matt had always been a little confusing, too. Even though his best friend hated Near more than anything in the world, Matt had never been less than courteous towards him, and sometimes he was even friendly. While Near did not doubt that this irritated Mello, for the most part it didn't seem as if Mello cared anymore. The only conclusion Near had been able to draw from this strange lack of solidarity between two boys that were almost always together was that Matt was so lacking in ambition that he didn't care about Near's ranking, and so easygoing that he believed that Mello hated Near more than enough for the both of them. Mello, who knew Matt better than anyone, must have known that Matt's actions were based in simple laziness, and so did not see it as a betrayal.

Matt's presence provided a strange sort of balance for the three of them. Sometimes, Near suspected that it was only Matt's laidback influence that kept Mello from outright murdering him.

"Why are you spying on us, Near?" growled Mello.

Near shrugged again.

"I was not spying on you, Mello," he replied. "As I said, I was simply passing by when I heard raised voices. …Although, I must admit that I am very curious as to what the two of you are doing during your detention that has you so excited."

Mello's glare grew even fiercer, and he looked like he was about to tell Near to go to hell, but Matt cut him off.

"It's a secret," he said, still smiling at Near in a way that stated clearly that he meant no offense.

"A secret?" Near repeated.

"Yep. Only Mello and I are allowed to know."

"That means," added Mello angrily, "that it's none of your business."

Near tilted his head to the side, if anything only more curious. For a moment he studied them: Mello, seething as usual, Matt, smiling lazily, and the mysterious papers covered in numbers.

"Very well," he said finally. "If the two of you are up to something illegal, however, I am going to have to report this."

"Why you little—"

Matt clamped his hand down on Mello's shoulder in an attempt to hold him back.

"It's nothing bad," he said. "Really, we're just studying."

He grinned, and then Mello smirked.

"Exactly," he said. "Just studying. And when we're done, you're welcome to try to figure it out."

With this last cryptic statement, Mello shoved Near into the hallway and slammed the door.

--

It wasn't until three weeks later that Near finally found out what they had been talking about. He was sitting in a corner of the main recreation room during one of his free periods playing with a blank puzzle when one of the teachers entered the room. The man immediately went up to Roger, who was quietly watching the children play, a grandfatherly smile on his face.

"Roger, may I speak to you for a moment?"

"Is there something the matter, Mr. Walters?"

The teacher brandished a folded scrap of paper.

"I've caught Mello and Matt passing notes in my class again," he said.

Roger sighed.

"Oh dear, already? Well, I guess there's no helping it—you'll simply have to give them detention again."

"Actually…" the teacher hesitated. "I want you to take a look at this."

The piece of paper changed hands. There was a short pause.

"I'm afraid I don't know what I'm looking at, Mr. Walters. What is it?"

"It's the note they were passing."

Another, longer pause.

"But it's just a list of numbers," said Roger, slight confusion audible in his voice.

"Exactly," replied the teacher. "At first I thought they were just pulling a prank on me, but I think it might actually have some sort of meaning for the two of them. They were treating it like the rest of the notes they've been passing all year, it's just…" he hesitated again, as if the next part was something he really didn't want to admit, "…completely incomprehensible to me," he finished.

"Hmm." Roger studied the paper. After a few minutes he sighed again. "Well, I'm afraid I can't make heads or tails of it, Mr. Walters."

"I was afraid of that," the teacher said. "I'm going to give them detention for three weeks this time, and no supper tonight. Perhaps then they will stop this nonsense."

"Now, Mr. Walters," Roger countered, "I'm not sure that would be the fair way of dealing with this. For all we know this _is_ only a list of numbers and they were simply playing a joke, or a game."

"But Roger! They could be _cheating_ and we wouldn't even know it!"

"Perhaps, but until we confirm that they are indeed using this… whatever it is, in a less than honest manner it would be unfair to punish them. Remember, this orphanage is founded and run on a principle of justi—"

"Excuse me."

The teachers turned to stare at the little boy who had interrupted them. Near, clutching his robot, had wandered over from his corner, curiosity peaked. The physics teacher, who had yet to have the small, white-haired genius in his class, frowned down at him.

"We're busy," he said condescendingly. "Go play with one of your friends until we are finished."

Near favored him with a long, slow, blank stare, before turning his attention to Roger. Roger, at least, knew that Near would never interrupt someone without a reason.

Roger sighed.

"Is there something you need, Near?" he asked kindly.

Near pointed at the piece of paper Roger was still holding.

"May I see that?" he asked politely. Roger shrugged and handed it to him.

"Can you understand it, Near?" he asked, after the eight year old had examined it for a long moment.

Near buried a finger in his hair and continued to stare at the numbers.

"It's a code," he said. "Mello and Matt were writing it during their detention a few weeks ago, I believe."

The teachers stared at him.

"Can you… read it?" asked Mr. Walters, shock written on his face.

Near smiled.

"No," he said. "But I would like to try, if you do not mind. May I keep this?"

Mr. Walters nodded. He had a feeling he was going to be confiscating a lot more of them in the future anyway.

"Thank you," said Near, pocketing the paper. He gave them another steady look.

"Yes, Near?" asked Roger. "Is there something else you would like to say?"

Near nodded.

"If you are still unsure of how to handle the situation with Mello and Matt," he said, "may I suggest that you ask L? Perhaps he will have an idea of a just solution to the problem."

"Thank you Near," said Roger, "we'll do that."

He had a feeling that L would want to hear about this regardless.

--

"YES!!" Matt crowed, pumping a fist into the air, but never taking his gaze from the screen of his computer.

"Will you please _shut up_?" called Mello from across their dorm room, nose buried in a textbook. "I'm trying to study over here, and I really don't care to know every time you score a point in your stupid game."

Matt turned in his chair, grinning.

"What if it's not a game?" he asked. Mello glanced up.

"Like I'd believe that," he said. "The only thing you _ever_ do with that thing is play games."

Matt frowned, feigning hurt.

"Now that's not fair," he said. "I do plenty with Elizabeth. Sure, I play games a lot, but I also write programs, use the internet for research, hack the security cameras…" he trailed off, and the grin was back.

Mello couldn't help but take the bait.

"Why would you want to hack the security cameras?" he asked. "There's no one interesting to spy on here."

"Maybe not," said Matt. "But the video feed on Roger's office can be quite interesting, especially when he's received a certain response from a certain detective about a certain Code…"

Mello was at his side in a second.

"What did L say?!"

Matt grinned.

"He said that if we've managed to create an unreadable code then the teachers have no right to punish us for it because we've been using our intelligence in a creative and constructive way. So they can't punish us for creating the Code or writing in it. _And_, since they don't know the content of the coded messages, they have no grounds for punishing us for that, either." Matt turned back to his computer screen, where a small picture of Roger was looking very unhappy. "So basically, as long as they don't catch us passing notes during tests…"

"We're completely safe," finished Mello, smirking. "Awesome."

"Yep," said Matt. "We rule."

They had a right to feel proud. It had taken them a full two weeks to flesh out the Code in every particular, and another two before they could read and write it with any speed. They had drawn from their own personal fields of expertise, Matt from his skills in computer code and math, and Mello from his broad knowledge of languages and linguistics. Before they could complete the Code, however, they had to teach each other the specifics of their side of the equation. Matt had learned from Mello about parts of speech, word order and agglutination, and in turn Mello had been taught about counting with numbers in bases other than ten. Matt had studied Greek, Russian, and Arabic, and Mello had learned Japanese—a language Matt had mastered long ago in order to better play his video games—and brushed up on German and Italian. With a broad base of knowledge established, they had written an impressive code.

It was to become one of the greatest unsolved puzzles in Wammy's House.

The genius of the Code was that its foundation was so simple: basic number substitution. Every letter of the alphabet was associated with a number, A being one, B being two, etc. The numbers were written in place of the letters. The complications began with the fact that depending on the part of speech, the letters of any given word would be written in a different number base from any other word. The only consistent factor was that they never worked with base ten, the number system people normally used.

Even this would not be terribly difficult to figure out in an orphanage of geniuses, but Mello had added an extra dimension. The Code could be written in any language, and depending on the linguistic features of the language that was being coded, the number bases changed again. A language in which adjectives came before nouns would use a different base than those in which adjective came after, for example. Because of this, every time they wrote in a different language the Code changed in almost every particular.

Matt and Mello made sure they switched languages often, just to confuse anyone trying to read it. It was not difficult for them to tell what languages they were using because they used specific numbers to mark certain parts of speech. By looking at the markers they could establish what types of words they were looking at and therefore determine what bases they were written in. By figuring out the bases, they could tell what language it was.

It had taken them two weeks after hammering out the details before they could read and write in the Code proficiently. They had to be both fluent in the languages they were writing in, and good at converting numbers into bases smaller than ten. After those two weeks of study, however, they could read and write it almost as easily as English.

Although neither would ever admit it, it turned out to be a useful experience for both of them. They both learned a good deal that they had not bothered to study before, as well as what it was like to teach someone else.

It was something they would both remember for the rest of their lives as one of their most enlightening experiences at Wammy's.

--

No one ever managed to crack the Code. Even Near, who studied it off and on in his spare time, never managed to get past one level of its complexities. His math scores were perfect, but he had never been as interested in numbers as Matt had, and while his linguistic skills were at least as good as Mello's, the numbers always managed to elude him. Every time he thought he had come close, the second- and third-place successors would learn a new language just to throw him off. And once a new language appeared, since Near did not know the markers, he would have to start again from scratch. It was one of their only victories over the boy perpetually labeled "number one."

There was one purpose of the Code, however, that even Mello never knew of.

Matt had suggested creating the Code for the simple reason of getting away with passing notes in class. That was all it had been intended for—at first. As the two of them worked together for weeks, however, learning from each other and becoming closer than ever, the idea of being able to write messages that only the two of them could read became very appealing to Matt. Suddenly, he had a more pressing reason to see the Code finished. More than just slighting their teachers or getting the better of Near, Matt had something to say, something no one else could ever see.

On the first night after the Code had been completed, Matt sat down at his desk with a sheet of paper and painstakingly wrote down a set of numbers:

137 14172658 4123337 2152020239

Then, because they had only just finished it and he wanted to make no mistakes, he worked backwards to be sure that his message was correct.

137. Noun, alphabetical number nine.

14172658. Verb, alphabetical numbers twelve, fifteen, twenty-two, and five.

4123337. Noun, alphabetical numbers twenty-five, fifteen, and twenty-one.

2152020239. Noun, alphabetical numbers thirteen, five, twelve, twelve, and fifteen.

Matt looked at the message, complete and correct, that he had written out.

9 -- I

12- L

15- O

22- V

5 -- E

25- Y

15- O

21- U

13- M

5 -- E

12- L

12- L

15- O

He sat staring at these words, their numbers, and the Code for a very long time. It represented all the work they had done, all the studying, all the arguments and compromises. It was like the Code was the purest symbol of their friendship. And maybe…

Matt sighed, and tore the paper into shreds, watching them flutter back to his desk before sweeping them into the trash can.

If he ever did tell Mello, he decided, he would do it to his face. He would respect their friendship, and he would be straightforward.

No puzzles, no riddles, and no writing in code.

Matt lay his head down on his desk, and hoped that one day he would have that kind of courage.

* * *

**Note: This story was actually spawned from another one about Mello and Matt that I'm still working on. I was writing a scene in which the two of them communicate in code, and I started wondering how they'd invented it and why. And so a new story was born... and I finished this one first. Near kind of hijacked the middle though. Originally he wasn't supposed to be in it at _all_, but I decided to give him a cameo and... well, he just sort of took over. ****And no, I have no idea why I think Matt would name his computer Elizabeth. He just strikes me as the type who would be attached enough to his electronics to name them. **

**Also, if anybody is curious--yes, I did have to make up a sort of pseudo-Code for Matt's message in the end. It's not the real code because, as I said, I'm not a genius, but it was kind of fun to make up. If anybody wants to see it, just let me know.**

**Please review! :)**


End file.
